package com.cian.entity.dto;

import com.cian.entity.Account;
import com.cian.entity.AccountInformation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Account的DTO对象,只用于传输经度，纬度，和具体信息", description="")
public class AccountDTO {

    @ApiModelProperty(value = "经度")
    private Double longitude;

    @ApiModelProperty(value = "纬度")
    private Double latitude;

    @ApiModelProperty(value = "具体信息")
    private String detail;

    @ApiModelProperty(value = "主服务器的授权码")
    private String licenseKey;


    public AccountDTO(){}

    /**
     * 将AccountInformation对象直接进行赋值
     * @param accountInformation AccountInformation对象
     */
    public AccountDTO(Account account, AccountInformation accountInformation){
        this.licenseKey = account.getLicenseKey();
        this.longitude = accountInformation.getMLongitude();
        this.latitude = accountInformation.getMLatitude();
        this.detail = accountInformation.getMDetail();
    }
}
